package cn.elricyu.tt.action.chat;

import java.util.List;

import net.sf.json.JSON;

import org.apache.commons.lang.StringUtils;

import cn.elricyu.tt.action.base.AbstractAction;
import cn.elricyu.tt.bean.ChatMessage;
import cn.elricyu.tt.bean.User;

public class ChatSendAction extends AbstractAction<List<ChatMessage>> {
	private User self = null;

	public ChatSendAction(User self, Channel channel, String receiver,
			String content) {
		this.self = self;
		this.url = "root/chat!send.action";
		this.postDataMap.put("channel", channel.getChannel());
		this.postDataMap.put("contant", content);
		if (StringUtils.isNotBlank(receiver)) {
			this.postDataMap.put("recver", receiver);
		} else {
			this.postDataMap.put("recver", channel.getReceiver());
		}
		this.toPause = false;
	}

	public void process(JSON json) {
		// ChatAction.doParseAll(self.getKey(), json);
	}
}
